package Day11.File;

import java.io.File;

public class Lian04 {
    public static void main(String[] args) {
//        method1();
//        method2();
//        method3();
        File file=new File("a.txt");
        String name = file.getName();
        System.out.println(name);
        File file2=new File("H:\\itheima");
        String name1 = file2.getName();
        System.out.println(name1);
    }

    private static void method3() {
        File file=new File("a.txt");
        boolean exists = file.exists();
        System.out.println(exists);
    }

    private static void method2() {
        File file=new File("H:\\itheima");
        boolean file1 = file.isFile();
        boolean directory = file.isDirectory();
        System.out.println(file1);
        System.out.println(directory);
    }


    private static void method1() {
        File file=new File("H:\\itheima\\a.txt");
        boolean file1 = file.isFile();
        boolean directory = file.isDirectory();
        System.out.println(file1);
        System.out.println(directory);
    }
}
